package com.sxjh.controller.financialrepost;

import com.sxjh.common.Result;
import com.sxjh.entity.param.DailyReportParam;
import com.sxjh.entity.param.FinancialSalesRepostParam;
import com.sxjh.entity.result.DailyReportResult;
import com.sxjh.entity.result.FinancialRepostResult;
import com.sxjh.entity.result.StatisticalBillsResult;
import com.sxjh.service.financialrepost.FinancialRepostService;
import com.sxjh.service.scalereport.ScaleReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zxz
 * @Date 2021/11/19
 * @Description: 财务销售对账报表控制层
 */
@RestController
@RequestMapping("/financial/sales/report")
@Api(tags = "财务销售对账报表")
public class FinancialSalesRepostController {
    @Autowired
    private FinancialRepostService financialRepostService;

    /*甲醇销售*/
    @ApiOperation("甲醇销售对账产品")
    @GetMapping("/jc/xs/dz/cp")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> jcXsDzCp(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(4);
        return Result.ok(financialRepostService.getReconciliationCustomerRepost(param));
    }

    @ApiOperation("甲醇销售对账客户")
    @GetMapping("/jc/xs/dz/kh")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> jcXsDzKh(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(4);
        return Result.ok(financialRepostService.getReconciliationProductRepost(param));
    }

    @ApiOperation("甲醇销售对账开票")
    @GetMapping("/jc/xs/dz/kp")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> jcXsDzKp(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(4);
        return Result.ok(financialRepostService.getReconciliationInvoicingRepost(param));
    }

    @ApiOperation("甲醇销售对账明细")
    @GetMapping("/jc/xs/dz/mx")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> jcXsDzMx(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(4);
        return Result.ok(financialRepostService.getReconciliationDetailRepost(param));
    }

    /*焦炭销售*/
    @ApiOperation("焦炭销售对账产品")
    @GetMapping("/jt/xs/dz/cp")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> jtXsDzCp(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(3);
        return Result.ok(financialRepostService.getReconciliationCustomerRepost(param));
    }

    @ApiOperation("焦炭销售对账客户")
    @GetMapping("/jt/xs/dz/kh")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> jtXsDzKh(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(3);
        return Result.ok(financialRepostService.getReconciliationProductRepost(param));
    }

    @ApiOperation("焦炭销售对账开票")
    @GetMapping("/jt/xs/dz/kp")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> jtXsDzKp(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(3);
        return Result.ok(financialRepostService.getReconciliationInvoicingRepost(param));
    }

    @ApiOperation("焦炭销售对账明细")
    @GetMapping("/jt/xs/dz/mx")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> jtXsDzMx(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(3);
        return Result.ok(financialRepostService.getReconciliationDetailRepost(param));
    }


    /*焦油加工销售*/
    @ApiOperation("焦油加工销售对账产品")
    @GetMapping("/jyjg/xs/dz/cp")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> jyjgXsDzCp(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(5);
        return Result.ok(financialRepostService.getReconciliationCustomerRepost(param));
    }
    @ApiOperation("焦油加工销售对账客户")
    @GetMapping("/jyjg/xs/dz/kh")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> jyjgXsDzKh(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(5);
        return Result.ok(financialRepostService.getReconciliationProductRepost(param));
    }
    @ApiOperation("焦油加工销售对账开票")
    @GetMapping("/jyjg/xs/dz/kp")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> jyjgXsDzKp(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(5);
        return Result.ok(financialRepostService.getReconciliationInvoicingRepost(param));
    }
    @ApiOperation("焦油加工销售对账明细")
    @GetMapping("/jyjg/xs/dz/mx")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> jyjgXsDzMx(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(5);
        return Result.ok(financialRepostService.getReconciliationDetailRepost(param));
    }

    /*苯精制销售*/
    @ApiOperation("苯精制销售对账产品")
    @GetMapping("/bjz/xs/dz/cp")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> bjzXsDzCp(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(6);
        return Result.ok(financialRepostService.getReconciliationCustomerRepost(param));
    }
    @ApiOperation("苯精制销售对账客户")
    @GetMapping("/bjz/xs/dz/kh")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> bjzXsDzKh(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(6);
        return Result.ok(financialRepostService.getReconciliationProductRepost(param));
    }
    @ApiOperation("苯精制销售对账开票")
    @GetMapping("/bjz/xs/dz/kp")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> bjzXsDzKp(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(6);
        return Result.ok(financialRepostService.getReconciliationInvoicingRepost(param));
    }
    @ApiOperation("苯精制销售对账明细")
    @GetMapping("/bjz/xs/dz/mx")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> bjzXsDzMx(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(6);
        return Result.ok(financialRepostService.getReconciliationDetailRepost(param));
    }

    /*化产品回收厂*/
    @ApiOperation("化产品回收厂销售对账产品")
    @GetMapping("/hcphsc/xs/dz/cp")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> hcphscXsDzCp(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(7);
        return Result.ok(financialRepostService.getReconciliationCustomerRepost(param));
    }
    @ApiOperation("化产品回收厂销售对账客户")
    @GetMapping("/hcphsc/xs/dz/kh")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> hcphscXsDzKh(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(7);
        return Result.ok(financialRepostService.getReconciliationProductRepost(param));
    }
    @ApiOperation("化产品回收厂销售对账开票")
    @GetMapping("/hcphsc/xs/dz/kp")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> hcphscXsDzKp(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(7);
        return Result.ok(financialRepostService.getReconciliationInvoicingRepost(param));
    }
    @ApiOperation("化产品回收厂销售对账明细")
    @GetMapping("/hcphsc/xs/dz/mx")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> hcphscXsDzMx(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(7);
        return Result.ok(financialRepostService.getReconciliationDetailRepost(param));
    }

    /*炭黑销售*/
    @ApiOperation("炭黑厂销售对账产品")
    @GetMapping("/th/xs/dz/cp")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> thXsDzCp(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(8);
        return Result.ok(financialRepostService.getReconciliationCustomerRepost(param));
    }
    @ApiOperation("炭黑厂销售对账客户")
    @GetMapping("/th/xs/dz/kh")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> thXsDzKh(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(8);
        return Result.ok(financialRepostService.getReconciliationProductRepost(param));
    }
    @ApiOperation("炭黑厂销售对账开票")
    @GetMapping("/th/xs/dz/kp")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> thXsDzKp(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(8);
        return Result.ok(financialRepostService.getReconciliationInvoicingRepost(param));
    }
    @ApiOperation("炭黑厂销售对账明细")
    @GetMapping("/th/xs/dz/mx")
//  @Authorization("cb.finance.list")
    Result<List<FinancialRepostResult>> thXsDzMx(@Validated FinancialSalesRepostParam param) {
        param.setCategoryId(8);
        return Result.ok(financialRepostService.getReconciliationDetailRepost(param));
    }

    @ApiOperation("炭黑分类统计报表")
    @GetMapping("/getStatisticalBills")
    Result<List<FinancialRepostResult>> getStatisticalBills(@Validated FinancialSalesRepostParam param) {
//        param.setCategoryId(4);
        return Result.ok(financialRepostService.getStatisticalBills(param));
    }

    /*杂醇销售*/
    @ApiOperation("杂醇销售对账产品")
    @GetMapping("/zc/xs/dz/cp")
//  @Auzcorization("cb.finance.list")
    Result<List<FinancialRepostResult>> zcXsDzCp(@Validated FinancialSalesRepostParam param) {
        param.setMaterialId(18);
        param.setCategoryId(4);
        return Result.ok(financialRepostService.getReconciliationCustomerRepost(param));
    }
    @ApiOperation("杂醇销售对账客户")
    @GetMapping("/zc/xs/dz/kh")
//  @Auzcorization("cb.finance.list")
    Result<List<FinancialRepostResult>> zcXsDzKh(@Validated FinancialSalesRepostParam param) {
        param.setMaterialId(18);
        param.setCategoryId(4);
        return Result.ok(financialRepostService.getReconciliationProductRepost(param));
    }
    @ApiOperation("杂醇销售对账开票")
    @GetMapping("/zc/xs/dz/kp")
//  @Auzcorization("cb.finance.list")
    Result<List<FinancialRepostResult>> zcXsDzKp(@Validated FinancialSalesRepostParam param) {
        param.setMaterialId(18);
        param.setCategoryId(4);
        return Result.ok(financialRepostService.getReconciliationInvoicingRepost(param));
    }
    @ApiOperation("杂醇销售对账明细")
    @GetMapping("/zc/xs/dz/mx")
//  @Auzcorization("cb.finance.list")
    Result<List<FinancialRepostResult>> zcXsDzMx(@Validated FinancialSalesRepostParam param) {
        param.setMaterialId(18);
        param.setCategoryId(4);
        return Result.ok(financialRepostService.getReconciliationDetailRepost(param));
    }
}
